package net.esj.basic.plugins.spring.support;

import javax.annotation.PostConstruct;

import net.esj.basic.utils.ApplicationBeanContext;

public abstract class AbstractApplicationMessageInterpolator {

	public abstract String getDefaultMessage();
	
	public abstract String getUserMessage();
	
	
	protected String getKeyCode(){
		return MessageUtils.getApplcationMessageResourceKey(getClass());
	}
	
	@PostConstruct
	protected void register(){
		ApplicationResourceBundleMessageSource app = new ApplicationResourceBundleMessageSource(getDefaultMessage(), getUserMessage());
		PlatformResourceBundleMessageSource prbms = ApplicationBeanContext.getApplicationContext().getBean(PlatformResourceBundleMessageSource.class);
		//prbms.registerApplicationMessageSource(getKeyCode(), app);
	}
}
